package com.firefly.web.controller.admin.ums;

import com.firefly.web.controller.admin.ConsoleApiRestController;
import com.firefly.dao.dto.ums.AdminLoginDto;
import com.firefly.service.command.ums.LoginCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @description: TODO 类描述 
 * @author: lzg(萤火科技 ： 854378082 @ qq.com)
 * @date: 2022/7/29
 **/
@ConsoleApiRestController("/")
public class LoginController {
    private LoginCommand loginCommand;
    @Autowired
    public LoginController(LoginCommand loginCommand){
        this.loginCommand = loginCommand;
    }
    @PostMapping("login")
    public Object postLogin(@Validated AdminLoginDto request, HttpServletRequest httpRequest) throws Exception {
        return loginCommand.postLogin(request,httpRequest.getRemoteAddr());
    }
}
